package BasicThread;

public class NamingAThread extends Thread {
	public void run(){
		System.out.println("runing...");
		System.out.println(Thread.currentThread().getName());/**The currentThread() method returns a 
		reference to the currently executing thread object. */
	}
	public static void main(String[] args) {
	NamingAThread t1 = new NamingAThread();
	NamingAThread t2 = new NamingAThread();
	System.out.println("Thread Name of- " +t1.getName());
	System.out.println("Thread Name of- " +t2.getName());
	System.out.println("Thread ID -" +t1.getId());
	System.out.println("Thread ID -" +t2.getId());
	t2.setName("Pr******");
	t1.start();
	
	
	t1.setName("Vibhanshu Shukla");
	
	System.out.println("Thread Name " +t1.getName());
	System.out.println("Thread Name " +t2.getName());

	t2.start();
	
	
	}

}
/** @output
 *Thread Name of- Thread-0
Thread Name of- Thread-1
Thread ID -8
Thread ID -9
Thread Name Vibhanshu Shukla
runing...
Thread Name Pr******
runing... 
 */
